﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ferreteria.Clases
{
    public class Validar
    {
        public static void ValidarNumeros(KeyPressEventArgs e)
        {
            if (Char.IsDigit(e.KeyChar))
                e.Handled = false;
            else if (Char.IsControl(e.KeyChar))
                e.Handled = false;
            else
                e.Handled = true;


        }

        public static void ValidarPrecios(KeyPressEventArgs e)
        {
            if (Char.IsDigit(e.KeyChar))
                e.Handled = false;
            else if (Char.IsControl(e.KeyChar))
                e.Handled = false;
            else if (Char.IsSymbol(e.KeyChar))
                e.Handled = false;
            else
                e.Handled = true;
        }
        public static void ValidarNrosconDecimales(KeyPressEventArgs e)
        {
            if (Char.IsDigit(e.KeyChar))
                e.Handled = false;
            else if (Char.IsControl(e.KeyChar))
                e.Handled = false;
            else if (Char.IsDigit(e.KeyChar))
                   e.Handled = false;
            else
                e.Handled = true;
        }
    }
}
